<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<table border="1">
    <caption>用户列表</caption>
    <tr>
        <th>用户名</th>
        <th>密码</th>
        <th>昵称</th>
    </tr>
</table>


<script>


    let arr = [{username: 'shangye', password: 123456, nickname: 'ye'},
        {username: 'qingxie', password: 123456, nickname: 'xie'},
        {username: 'southwind', password: 123456, nickname: 'wind'},]

    for (const user of arr) {
      let tr = document.createElement("tr");
      let username = document.createElement("td");
      let password = document.createElement("td");
      let nickname = document.createElement("td");
      username.innerText = user.username;
      password.innerText = user.password;
      nickname.innerText = user.nickname;

      tr.append(username,password,nickname)

      let table = document.querySelector("table")
      table.append(tr)

    }
</script>
</body>
</html>